package com.zline.foodraise.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;

import com.zline.foodraise.entity.PictureBean;
import com.zline.foodraise.entity.ProjectBean;
import com.zline.foodraise.util.LUtil;
import com.zline.foodraise.view.AttentionViewPageCardItem;
import com.zline.foodraise.view.AttentionViewPageCardItem_;
import com.zline.foodraise.view.RecyclerViewLoadMore_;

import org.androidannotations.annotations.EBean;
import org.androidannotations.annotations.RootContext;

import java.util.List;

/**
 * Created by heshantao on 15/7/17.
 * 我下面的关注Adapter
 */
@EBean
public class AttentionViewPageRecyclerAdapter extends LoadRecyclerBaseAdapter<ProjectBean, AttentionViewPageCardItem> {
    private static final String LOG_TAG = AttentionViewPageRecyclerAdapter.class.getSimpleName();
    @RootContext
    Context cxt;

    @Override
    protected AttentionViewPageCardItem onCreateItemView(ViewGroup parent, int viewType) {
        return AttentionViewPageCardItem_.build(cxt);
    }

    @Override
    protected BottomWrapper onCreateBottomView(ViewGroup parent, int viewType) {
        return new BottomWrapper(RecyclerViewLoadMore_.build(cxt));
    }


    @Override
    public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
        if (holder instanceof ContentWrapper) {
            AttentionViewPageCardItem view = (AttentionViewPageCardItem) ((ContentWrapper) holder).getView();
            ProjectBean projectBean = (ProjectBean) arrys.get(position);
            view.setListener(itemClicked);
            view.bind(projectBean,position);
        }
    }
}
